SELECT DISTINCT CONCAT( "/", demographic_no, "/" ) AS "Master Demo", appointment_date as "appointment date", name as "Patient Name" FROM appointment WHERE appointment_date BETWEEN "{start}" AND "{end}" AND status <> "e" AND demographic_no<>0 AND provider_no = "{provider}"; select '%' as provider_no, 'All Providers' as provider union select provider_no, concat(last_name,',',first_name,'(',provider_no,')') from provider where status='1' and ohip_no>1 and ohip_no != 123456 order by provider_no;